import { axios } from '@/utils/request'

export function getCollectionTaskList (params) {
    return axios({
        url: 'collection/task',
        method: 'get',
        params
    })
}

export function getCollectionHistoryList (params) {
    return axios({
        url: 'collection/history',
        method: 'get',
        params
    })
}

export function getCollectionList (params) {
    return axios({
        url: 'collection',
        method: 'get',
        params
    })
}

export function getCollectionReportList (params) {
    return axios({
        url: 'collection/report',
        method: 'get',
        params
    })
}

export function getCollectionAccount (params) {
    return axios({
        url: 'collection/account',
        method: 'get',
        params
    })
}

export function addCollectionAccount (data) {
    return axios({
        url: 'collection/account',
        method: 'post',
        data
    })
}

export function updateCollectionAccount (id, data) {
    return axios({
        url: `collection/account/${ id }`,
        method: 'put',
        data
    })
}

export function delCollectionAccount (id) {
    return axios({
        url: `collection/account/${ id }`,
        method: 'delete'
    })
}

export function getCollectionDetail (id, params) {
    return axios({
        url: `collection/${ id }`,
        method: 'get',
        params
    })
}

export function handleCollectionTask (id, data) {
    return axios({
        url: `collection/${ id }`,
        method: 'post',
        data
    })
}

export function assignTask (data) {
    return axios({
        url: 'collection/assign_task',
        method: 'post',
        data
    })
}

export function getCollectionStage () {
    return axios({
        url: 'collection/stage',
        method: 'get'
    })
}

export function editCollectionStage (data) {
    return axios({
        url: 'collection/stage',
        method: 'post',
        data
    })
}

export function getAchievement (params) {
    return axios({
        url: 'collection/achievement',
        method: 'get',
        params
    })
}
